package com.vortex.cloud.zhsw.xinyang.converter;

import com.github.liaochong.myexcel.core.converter.ConvertContext;
import com.github.liaochong.myexcel.core.converter.reader.AbstractReadConverter;
import com.vortex.cloud.vfs.lite.base.dto.GeometryDTO;
import org.apache.commons.lang3.StringUtils;

import java.lang.reflect.Field;

/**
 * GeometryDTO导入转换
 * @author huohao@vortexinfo.cn
 * @date 2022/3/17 15:04
 */
public class GeometryReadConverter extends AbstractReadConverter<GeometryDTO> {
    @Override
    protected GeometryDTO doConvert(String value, Field field, ConvertContext convertContext) {
        GeometryDTO geometryDTO = new GeometryDTO();
        if (StringUtils.isNotEmpty(value)) {
            geometryDTO.setLngLats(value);
        }
        return geometryDTO;
    }
}
